const t = require("../../config/dict");
const package = require("../../package.json");
const chalk = require("chalk");
const { log } = require("../utils");

module.exports = (context) => {
  return new Promise((resolve, reject) => {
    console.log("");
    log("tip", { message: package.name.toLocaleUpperCase() });
    console.log("");
    log("tip", {
      message: [
        t(context.lang, "版本") + ":",
        chalk.blue(package.version),
      ].join(" "),
    });
    /* log("tip", {
      message: [t(context.lang, "当前源") + ":", chalk.blue(_LOCALSOURCE)].join(
        " "
      ),
    }); */
    /* log("tip", {
      message: [
        t(context.lang, "当前配置文件") + ":",
        chalk.blue(
          (process.env.CUSTOMCONFIG &&
            path.resolve(process.cwd(), process.env.CUSTOMCONFIG)) ||
            (config.template && config.template.url)
        ),
      ].join(" "),
    });
    log("tip", {
      message: [
        t(context.lang, "当前语言包") + ":",
        chalk.blue(
          (process.env.LANGPACK &&
            path.resolve(process.cwd(), process.env.LANGPACK)) ||
            (config.language && config.language.langPack)
        ),
      ].join(" "),
    });
    log("tip", {
      message: [
        [t(context.lang, "当前"), t(context.lang, "跳过设置") + ":"].join(" "),
        chalk.blue(
          (process.env.IGNORE &&
            path.resolve(process.cwd(), process.env.IGNORE)) ||
            config.LOCALIGNORE
        ),
      ].join(" "),
    }); */
    log("tip", {
      message: [
        t(context.lang, "调试") + ":",
        chalk.blue(process.env.DEBUG),
      ].join(" "),
    });
    console.log("");
    resolve(context);
  });
};
